<template>
    <div>
        <van-tabbar v-model="active">
            <van-tabbar-item
                v-for="(item,index) in tabbars"
                :key="index"
                :to="(item.name)"
				:icon="item.icon"
            >
                <span>{{item.title}}</span>
                
            </van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script>
export default {
	data() {
		return {
			active:null,
			tabbars: [
				{
					name: "/updateInfo",
					title: "补全信息",
					icon:"home-o"
				},
				{
					name: "/payment",
					title: "戍码分期",
					icon:"bill-o"
				},
				{
					name: "/my",
					title: "我的",
					icon:"user-o"
				}
			]
		};
	},
	methods: {

	},
	// 通过路由跳转判断选中的样式
	created() {
		if (this.$route.name == "updateInfo") {
			this.active = 0;
		} else if (this.$route.name == "payment") {
			this.active = 1;
		} else if (this.$route.name == "my") {
			this.active = 2;
		}
	}
};
</script>

<style  scoped>

</style>